home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
progs
/
thor
/
examples
/
findfile.br
< prev
next >
Wrap
Text File
|
1996-11-10
|
2KB
|
105 lines
/* FindFiles.br
*
* Arexx script to find files on a bbs.
*
* Script by: Eivind Nordseth, Ultima Thule Software.
*/
options results
parse arg argument
template = 'BBSNAME/A,REST/F'
if(argument = '' | argument = '?') then
do
say '$VER: FindFiles.br 3.3 (12.09.94)'
say 'Template: BBSNAME/A,FAREANAME/K,SEARCH/K,NAME/S,KEYWORD/S,NEWERTHAN/K/N'
exit
end
if ~show('p', 'BBSREAD') then do
address command
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
"WaitForPort BBSREAD"
end
address "BBSREAD"
signal on ERROR
READARGS template ARGS CMDLINE argument
if(rc ~= 0) then
do
say BBSREAD.LASTERROR
exit
end
SEARCHBRFILE bbsname '"' || ARGS.BBSNAME || '"' stem SRESULT ARGS.REST
if(result > 0) then
do
do f=1 to SRESULT.FILEAREA.COUNT
say '0a'x || '(' || SRESULT.FILEAREA.f || ')'
do i=1 to SRESULT.FILE.f.COUNT
call showfiledata('"' || ARGS.BBSNAME || '"', '"'|| SRESULT.FILEAREA.f || '"', SRESULT.FILE.f.i)
end
end
end
else say 'No files found'
exit
/* Procedure to show the data about a file */
showfiledata: procedure
parse arg bbs,farea,filenr
FDF_DELETED = '00000001'x
drop FILE. /* Important */
READBRFILE bbs farea filenr tagsstem FILE datastem DATA
nextfile = result
if (bitand(DATA.FLAGS,FDF_DELETED) ~= FDF_DELETED) then
do
if(symbol("FILE.DATE") = "VAR") then fdate = FILE.DATE
else date = DATA.FILEDATE
AMIGA2DATE fdate CD
fdatestr = right(CD.YEAR, 2) || right('0'||CD.MONTH, 2) || right('0'||CD.MDAY, 2)
if(symbol("FILE.SIZE") = "VAR") then fsize = FILE.SIZE
else size = "Unkn"
if(symbol("FILE.DOWNLOADS") = "VAR") then fdnls = FILE.DOWNLOADS
else fdnls = "Unkn"
if(symbol("FILE.DESCRIPTION.COUNT") = "VAR") then descr = FILE.DESCRIPTION.1
else descr = "NONE"
say left(FILE.NAME,16) || " " || fdatestr || " " || right(fsize,7) || right(fdnls,4) || " " || descr
if(descr ~= "NONE") then
do
if(FILE.DESCRIPTION.COUNT > 1) then
do
do n=2 to FILE.DESCRIPTION.COUNT
say left("",33) || FILE.DESCRIPTION.n
end
end
end
end
else say 'File is deleted'
return nextfile
ERROR:
if(rc ~= 0) then
do
say 'Error' rc 'in line' SIGL ':' BBSREAD.LASTERROR
exit
end
exit